package com.ch.databinddemo

import android.util.Log
import androidx.databinding.BaseObservable
import androidx.databinding.Bindable

class UserModel(var penson: Penson) : BaseObservable() {
//    private var user: User = User("chenhu")


    @Bindable
    fun getUserName(): String {
        return this.penson.sex
    }

    fun setUserName(name: String) {
        Log.e("Hogan", "${penson.sex}   $name")
        penson.sex = name
        notifyPropertyChanged(BR.userName)
    }
}